programming4us
           
 
 
SQL Server

Obtaining General Information About Linked Servers

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
10/24/2010 4:47:35 PM
You can use both SQL Server Management Studio and the system stored procedures to gather information about linked servers and the referenced data sources. Following are some of the most-often-used system stored procedures:
  • sp_linkedservers— This returns a list of linked servers defined on the local server.

  • sp_catalogs— This displays a list of catalogs and descriptions for a specified linked server.

  • sp_indexes— This shows index information for a specified remote table.

  • sp_primarykeys— This returns the primary key columns for the specified table.

  • sp_foreignkeys— This lists the foreign keys defined for the remote table.

  • sp_tables_ex— This displays table information from the linked server.

  • sp_columns_ex— This returns column information for all columns or a specified column for a remote table.

  • sp_helplinkedsrvlogin— This displays the linked server login mappings for each linked server.

For example, at query prototyping time, it is useful to see all the ways the linked server objects and columns are being referenced (especially when you’re dealing with other data sources, such as Excel spreadsheets).

First, the exact linked object name is displayed via the sp_tables_ex system stored procedure. In this case, you would see the following for the ACCESS_DATABASE_CUSTOMERS linked server just created:

EXECUTE sp_tables_ex 'ACCESS_DATABASE_CUSTOMERS'
go
TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS
--------- ----------- ------------ ------------ -------
NULL NULL MSysAccessObjects ACCESS TABLE
NULL NULL MSysACEs SYSTEM TABLE
NULL NULL MSysObjects SYSTEM TABLE
NULL NULL MSysQueries SYSTEM TABLE
NULL NULL MSysRelationships SYSTEM TABLE
NULL NULL SWCustomers TABLE

Then you can see all the table columns of that linked server’s data source by using the sp_columns_ex system stored procedure. The following command provides the column definitions for the SWCustomers Access table for the linked server 'ACCESS_DATABASE_CUSTOMERS':

EXECUTE sp_columns_ex 'ACCESS_DATABASE_CUSTOMERS'
go
TABLE_CAT TABLE_SCH TABLE_NAME COLUMN_NAME TYPE_NAME SIZE
------------------------------------- ------------ ---------- -------
NULL NULL MSysAccessObjects Data VarBinary 3992
NULL NULL MSysAccessObjects ID Long 10
NULL NULL SWCustomers CustomerID VarChar 255
NULL NULL SWCustomers CompanyName VarChar 255
NULL NULL SWCustomers ContactName VarChar 255
NULL NULL SWCustomers ContactTitle VarChar 255
NULL NULL SWCustomers Address VarChar 255
NULL NULL SWCustomers City VarChar 255
NULL NULL SWCustomers Region VarChar 255
NULL NULL SWCustomers PostalCode Double 15
NULL NULL SWCustomers Country VarChar 255
NULL NULL SWCustomers Phone VarChar 255
NULL NULL SWCustomers Fax VarChar 255
Other -----------------
- Executing a Stored Procedure via a Linked Server
- Setting Up Linked Servers Using SQL Server Management Studio
- Encryption basics for SQL Server : Cryptographic Keys
- Encryption basics for SQL Server : Key Maintenance
- Encryption basics for SQL Server : Key Algorithms
- SQL Server 2005 : Performing Database Backups
- SQL Server 2005 : Restoring Data from a Backup
- SQL Server 2005 : Using Database Snapshots
- SQL Server 2005 : Automating Maintenance with Job Scheduling
- Other SQL Server XML Support
- SQL Server 2005 : Managing XML Data (part 2) - The xml Data Type and Methods
- SQL Server 2005 : Managing XML Data (part 1)
- SQL Server : Removing Unwanted Data
- SQL Server : Changing What Is Already Stored
- Using System Tables and Views
- SQL Server 2005 : Data Querying Using Full-Text Indexes
- SQL Dependency Reporting
- The Overall Disaster Recovery Process
- Microsoft SQL Server Options for Disaster Recovery
- How to Approach Disaster Recovery
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us